<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>096-按无序列表项中值对列表排序.html</title>
</head>
<body>
	<ul id="ul2">
		<li>12</li>
		<li>8</li>
		<li>25</li>
		<li>64</li>
		<li>5</li>
		<li>69</li>
	</ul>
	<button id="btn">排序</button>
</body>
<script>
	var oUl = document.getElementById('ul2');
	var oBtn = document.getElementById('btn');
	// var aLi = oUl.children;

	oBtn.onclick = function(){
		var newLi = [];
		for(var i =0;i<aLi.length;i++){
			newLi.push(aLi[i]);
		}
		// console.log(aLi);
		newLi.sort(function(aLi1,aLi2){
			console.log(aLi1,aLi2);
			return aLi1.innerHTMl - aLi2.innerHTMl;
		});
		console.log(newLi);

		for(var j =0;j<newLi.length;j++){
			oUl.appendchild(newLi[j]);
		}

		// oUl.sort();
		// console.log(aLi);
	}
</script>
</html>